/** @jsxImportSource @emotion/react */
import * as React from "react";
import { OriginalViewProps, } from "../../common/base";
import {config设备概况, EntranceSetup} from "./orcBase";
import { createItem, } from "../../common/eHelper";
import { useRecordListSubr} from "../../hook/useRecordListSub";
import {ConclusionAnnualW } from "./Conclusion";
import {AppendixPage, } from "./AppendixPage";
import {tail附页} from "./orcBase";
import {AttachedPage} from "./AttachedPage";
import {ConclusionSurvey} from "../../gas/plastics/Conclusion";
import {ProjectR} from "../../gas/utilityNj/ProjectR";

//参数 @om =ture: 只是在记录目录存在的，但是在正式报告目录却不显示的。 @na表示在两个目录页都不存在。
export const Projects记录=[
    {name:'设备概况与检验结论',do:true,ha:'Conclusion'},
    {name:'年度检查报告附页(一)',do:true,ha:'AppendixPage',},
    //附页3？附图或说
    {name:'附页附图',ha:'AttachedPage',om:false},
];

const recordPrintList =[
    createItem('Entrance', <EntranceSetup/>),
    createItem('ProjectList', <ProjectR config={Projects记录} label={'记录目录页'}/>),
    createItem('Survey', <ConclusionSurvey config={config设备概况} label={'压力容器年度检查-设备概况'}/>),

    createItem('Conclusion', <ConclusionAnnualW label={'压力容器年度检查-下结论'}/>),
    createItem('AppendixPage', <AppendixPage label={'压力容器年度检查报告附页（上）'} children={tail附页}/>),
    createItem('ApxIspItms_15', <AppendixPage part={2} label={'压力容器年度检查报告附页（中）'} children={tail附页}/>),
    createItem('ApxIspItms_29', <AppendixPage part={3} label={'压力容器年度检查报告附页（下）'} children={tail附页}/>),

    createItem('AttachedPage', <AttachedPage table={'附页表'} memrow={12} label={'附页附图'}/>),
    createItem('_Controller',  <></>),
];

export const OriginalView=
  React.forwardRef((
    { action: modAction,  verId, repId='', rep}
    :OriginalViewProps, ref
  ) => {
    const {list}=useRecordListSubr(ref,rep,recordPrintList,modAction,verId);
    return <React.Fragment>
      {list}
    </React.Fragment>;
  } );
